package com.yitao.client.constant;

import com.yitao.client.dto.enums.EnumDto;

import java.util.ArrayList;
import java.util.List;

/**
 * Function:
 * Date: 2018/12/5
 *
 * @author skipper
 * @desc 商品相关枚举
 * @see
 */
public  class ProductConstant {

    /**
     * 商品类型相关枚举
     */
    public enum ProductTypeEnum {
        //普通商品
        GENERAL(1,"普通商品"),
        //特价商品
        GROUP(2,"特价商品");

        private final Integer code;
        private final  String desc;

        ProductTypeEnum(Integer code,String desc) {
            this.code = code;
            this.desc = desc;

        }

        public Integer getCode() {
            return code;
        }
        public String getDesc() {return desc;}

        public static List<EnumDto> getProductTypeEnum(){
            List<EnumDto> list = new ArrayList<>();
            for (ProductConstant.ProductTypeEnum e : ProductConstant.ProductTypeEnum.values()){
                EnumDto enumDto = new EnumDto();
                enumDto.setCode(e.code);
                enumDto.setDesc(e.desc);
                list.add(enumDto);
            }
            return list;
        }

    }
    /**
     * 商品图片状态枚举
     */
    public enum ProductImageStateEnum {
        PROCESSED(0,"已处理"),
        RUHUA_UNDISPOSED(1,"如花未处理"),
        ROLLIN_US_UNDISPOSED(2,"美国买手版未处理");

        private final Integer code;
        private final  String desc;

        ProductImageStateEnum(Integer code,String desc) {
            this.code = code;
            this.desc = desc;

        }

        public Integer getCode() {
            return code;
        }
        public String getDesc() {return desc;}

    }


    /**
     * 商品分类类型枚举
     */
    public enum ProductCategoryTypeEnum {
        //基础分类
        BASICS_CATEGORY(1,"基础分类"),
        //运营分类
        OPERATION_CATEGORY(2,"运营分类");

        private final Integer code;
        private final String desc;

        ProductCategoryTypeEnum(Integer code,String desc) {
            this.code = code;
            this.desc = desc;

        }

        public Integer getCode() {
            return code;
        }
        public String getDesc() {return desc;}
        public static List<EnumDto> getProductCategoryTypeEnum(){
            List<EnumDto> list = new ArrayList<>();
            for (ProductConstant.ProductCategoryTypeEnum e : ProductConstant.ProductCategoryTypeEnum.values()){
                EnumDto enumDto = new EnumDto();
                enumDto.setCode(e.code);
                enumDto.setDesc(e.desc);
                list.add(enumDto);
            }
            return list;
        }

    }


    /**
     * 商品类型相关枚举
     */
    public enum BusinessTypeEnum {
        //商城商品
        STORE(1,"商城商品"),
        //如花商品
        RUHUA(2,"如花商品"),
        ROLLIN(3,"买手版商品"),
        ROLLIN_US(4,"美国买手版商品"),
        MACYS(100,"MACYS");


        private final Integer code;
        private final String desc;

        BusinessTypeEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;

        }

        public Integer getCode() {
            return code;
        }
        public String getDesc() {return  desc;}

    }


    /**
     * 币种枚举
     */
    public enum CurrencyTypeEnum {
        //人民币
        RMB("RMB"),
        //美元
        USA("USA");


        private final String code;

        CurrencyTypeEnum(String code) {
            this.code = code;

        }

        public String getCode() {
            return code;
        }

    }

    /**
     * 商品库存枚举
     */
    public enum ProductStockTypeEnum {
        //手工实际库存
        PHYSICAL_HOLDING_STOCK(1),
        //手工虚拟库存
        VIRTUAL_INVENTORY(2),
        //对接库存
        DOCKING_INVENTORY(3);

        private final Integer code;

        ProductStockTypeEnum(Integer code) {
            this.code = code;

        }

        public Integer getCode() {
            return code;
        }

    }

    /**
     * 商品评价是否删除
     */
    public enum ProductCommentDel {
        NO(0, "未删除"),
        YES(1, "已删除");

        private Integer code;
        private String msg;

        ProductCommentDel(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public Integer getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }

    /**
     * 商品评价是否被禁用
     */
    public enum ProductCommentAudit {
        NO(0, "未禁用"),
        YES(1, "已禁用");

        private Integer code;
        private String msg;

        ProductCommentAudit(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public Integer getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }


    /**
     * 商品推荐类型
     */
    public enum ProductRecommendType {
        //首页推荐
        HOME_PAGE(0),
        //猜你喜欢
        GUESS_YOU_LIKE(1);

        private Integer code;


        ProductRecommendType(Integer code) {
            this.code = code;

        }

        public Integer getCode() {
            return code;
        }

    }

    /**
     * 商品分类推荐类型
     */
    public enum ProductCategoryRecommendType {
        //BANNER 下方推荐分类
        UNDER_BANNER(1,"BANNER 下方推荐分类"),
        //首页推荐
        HOME_PAGE(2,"首页推荐"),
        //特色专区
        SPECIAL_AREA(3,"特色专区"),
        //在分类列表中 基础分类上方的运营分类
        ABOVE_BASICS(4,"分类列表-基础分类上方的运营分类");
        private Integer code;
      private String desc;


        ProductCategoryRecommendType(Integer code,String desc) {
            this.code = code;
            this.desc = desc;

        }

        public Integer getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }

        /**
         * 根据Id查询描述
         * @param code
         * @return
         */
        public static String getDescByCode(Integer code) {
            for (ProductConstant.ProductCategoryRecommendType e : ProductConstant.ProductCategoryRecommendType.values()) {
                if (e.getCode().equals(code)) {
                    return e.getDesc();
                }
            }
            return null;
        }
        public static List<EnumDto> getProductCategoryRecommendTypeEnum(){
            List<EnumDto> list = new ArrayList<>();
            for (ProductConstant.ProductCategoryRecommendType e : ProductConstant.ProductCategoryRecommendType.values()){
                EnumDto enumDto = new EnumDto();
                enumDto.setCode(e.code);
                enumDto.setDesc(e.desc);
                list.add(enumDto);
            }
            return list;
        }

    }

    /**
     * 分区类型枚举
     */
    public enum ProductPrefectureType {
        //商品
        PRODUCT(1),
        //资讯
        MESSAGE(2),
        //运营分类
        OPERATION(3);


        private Integer code;


        ProductPrefectureType(Integer code) {
            this.code = code;

        }

        public Integer getCode() {
            return code;
        }

    }


    /**
     * 分区类型枚举
     */
    public enum ProductOrderByType {
        //销量降序
        SALES_VOLUME_DESC(1),
        //按销量升序
        SALES_VOLUME_ASC(2),
        //价格降序
        PRICE_DESC(3),
        //按价升序
        PRICE_ASC(4)
        ;

        private Integer code;


        ProductOrderByType(Integer code) {
            this.code = code;

        }

        public Integer getCode() {
            return code;
        }

    }

    public enum ImgTypeEnum{
        BANNER(1, "商品轮播主图"),
        DETAILS(2,"商品详情图"),
        SKU(3,"SKU图片");

        private final Integer code;
        private final String desc;

        ImgTypeEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }

    public enum OperationTypeEnum{
        SEE(1, "商品详情查看"),
        SHOPPINGCART(2, "商品加入购物车"),
        INDEX_SEARCH(3, "首页搜索");

        private final Integer code;
        private final String desc;

        OperationTypeEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }

    /**
     * 是否可用状态码
     */
    public enum ProductEnableEnum {
        NO(0, "不可用"),
        YES(1, "可用");

        private Integer code;
        private String desc;

        ProductEnableEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }

    /**
     * 商品自动下架执行枚举
     */
    public enum EXECUTED_TASK_ENUM{
        UNEXECUTED(0, "未执行"),
        FAILURE_TO_EXECUTED(1, "执行失败"),
        EXECUTED(2, "已执行"),
        EXECUTED_ERROR(3, "执行异常"),
        MANUAL_LOWER_SHELF(4, "手动下架")
        ;

        private Integer code;
        private String desc;

        EXECUTED_TASK_ENUM(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }

    /**
     * 商品是否自动下架
     */
    public enum TASK_LOWER_SHELF_ENUM{
        NO(0, "否"),
        YES(1, "是");

        private Integer code;
        private String desc;

        TASK_LOWER_SHELF_ENUM(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }

    /**
     * 商品分享文案
     */
    public enum PRODUCT_SHARE_ENUM{
        DIRECT_DESCENDING("直降"),
        DIRECT_MAIL("直邮价"),
        ;

        private String msg;

        PRODUCT_SHARE_ENUM(String msg) {
            this.msg = msg;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }
    }

}
